package org.example.back.service.Forum;

import org.example.back.entity.Forum.ForumMedia;
import org.example.back.mapper.Forum.ForumMediaMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ForumMediaService {

    private final ForumMediaMapper forumMediaMapper;

    @Autowired
    public ForumMediaService(ForumMediaMapper forumMediaMapper) {
        this.forumMediaMapper = forumMediaMapper;
    }

    public void addMedia(ForumMedia media) {
        forumMediaMapper.insertMedia(media);
    }

    public List<ForumMedia> getMediaByPostId(Long postId) {
        return forumMediaMapper.selectMediaByPostId(postId);
    }
}
